#include <stdio.h>
#include <math.h>
#define N 200
int main (void){
	int i,j,n,a[N+1];
	for (i=2;i<=N;i++)
		a[i]=i;
	for (i=2;i<=sqrt(N);i++)
		if (a[i]){
			for (j=2*i;j<=N;j+=i)
				a[j]=0;
		}
	for (i=2,n=0;i<=N;i++){
		if (a[i]){
			printf ("%6d",i);
			n++;
		}
		if (n==10){
			printf("\n");
			n=0;
		}
	}
	printf("\n");
	return 0;
}